Read composefs configuration from initrd instead of commandline
authorAlexander Larsson <alexl@redhat.com>
Tue, 8 Aug 2023 11:16:39 +0000 (13:16 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 14 Aug 2023 10:27:47 +0000 (12:27 +0200)
commit81fa21415566ed45aa8aa154819b02955dc750a8
treef3825a8a7fc3fa862b430d920fa9ee630836df7b
parent2cc6b531996d016b3c6d114deb1c3f6f29162d02
Read composefs configuration from initrd instead of commandline

This drops the `ot-composefs` kernel commandline in favour
of a `[composefs]` section in the `prepare-rootfs.conf` file.

You can set `composefs.enabled` to `signed`, `yes`, `no` or `maybe`,
with `maybe` being the default.

You can also set `composefs.keypath` (or rely on the default
`/etc/ostree/initramfs-root-binding.key`) to point to ed25519 public
keys, one of which which the commit must be signed with, or boot
fails.

The ostree dracut module adds `/etc/ostree/initramfs-root-binding.key`
to the initrd if it exists.

NOTE: This drop the option to define a digest in the commandline.
However, that was currently unused
(i.e. ComposefsConfig.expected_digest was never read).

Additionally it very hard to actually store the composefs digest in
the initrd, as the initrd is typically part of the commit and thus the
composefs. It may be possible to handle this, but lets add it back
when we know exactly how that will work.
docs/composefs.md
man/ostree-prepare-root.xml
src/boot/dracut/module-setup.sh
src/switchroot/ostree-prepare-root.c